from time import time

class A():
    def decorator(origin):
        def inner(*args, **kwargs):
            print(args,kwargs)
            start = time()
            result = origin(*args, **kwargs)
            print(time() - start)
            return result
        return inner

    @decorator
    def test(name):
        print('test')

A.test('wyl350')

class B():
    def decorator():
        def outter(origin):
            def inner(*args, **kwargs):
                print(args,kwargs)
                start = time()
                result = origin(*args, **kwargs)
                print(time() - start)
                return result
            return inner
        return outter

    @decorator()
    def test(name):
        print('test')


B.test('wyl350')

class C():
    def times(n):
        def outter(origin):
            def inner(*args, **kwargs):
                for _ in range(0, n):
                    result = origin(*args, **kwargs)
                return result
            return inner
        return outter

    @times(100)
    def test():
        print('test')

C.test()

